﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using com.nm.Attributes;

namespace PlanAPI.model
{
    public class PLItemPricePeriodModel
    {
        #region 原始Entity

        /// <summary>
        /// PLItemPricePeriodModel数据表实体
        /// </summary>
        public class Entity
        {

            [ParamDescription("公司代码")]
            public string CompanyID { get; set; }

            [ParamDescription("年份")]
            public int Yearv { get; set; }

            [ParamDescription("月份")]
            public int Monthv { get; set; }

            [ParamDescription("全国/店铺")]
            public int AreaOrShop { get; set; }

            [ParamDescription("商品分区")]
            public string ParentAreaID { get; set; }

            //[ParamDescription("店铺")]
            //public string ShopID { get; set; }

            [ParamDescription("类别")]
            public string KindID { get; set; }

            [ParamDescription("系列")]
            public string SeriesID { get; set; }

            [ParamDescription("商品层")]
            public string MaterialProperty { get; set; }

            [ParamDescription("品类")]
            public string ModelID { get; set; }

            [ParamDescription("小品类")]
            public string ItemID { get; set; }

            [ParamDescription("价格带")]
            public string PriceName { get; set; }

            [ParamDescription("配货数量")]
            public int MoveQty { get; set; }

            [ParamDescription("配货金额占比")]
            public decimal MoveQtyRate { get; set; }

            [ParamDescription("供货金额")]
            public int SupplyQty { get; set; }

            [ParamDescription("供货金额占比")]
            public decimal SupplyQtyRate { get; set; }

            [ParamDescription("销售金额")]
            public int SaleQty { get; set; }

            [ParamDescription("销售金额占比")]
            public decimal SaleQtyRate { get; set; }

            [ParamDescription("配销比")]
            public decimal MSRate { get; set; }

            [ParamDescription("平均配销比")]
            public decimal AvgMSRate { get; set; }

            [ParamDescription("标准金额占比")]
            public decimal StandAmountRate { get; set; }

            [ParamDescription("换算百分比")]
            public decimal CalcStandAmountRate { get; set; }

            [ParamDescription("即自动取值")]
            public decimal PtStandAmountRate { get; set; }

            [ParamDescription("标准金额百分比")]
            public decimal AutoStandAmountRate { get; set; }

            [ParamDescription("确认标准金额百分比")]
            public decimal CkPtStandAmountRate { get; set; }

            [ParamDescription("平均单价")]
            public decimal AvgPrice { get; set; }

            [ParamDescription("备注")]
            public string Remark { get; set; }

            [ParamDescription("审核状态")]
            public int CheckState { get; set; }

            [ParamDescription("审核人")]
            public string Checker { get; set; }

            [ParamDescription("修改时间")]
            public DateTime MofifyDTM { get; set; }

            [ParamDescription("新增记录标记")]
            public int AddFlag { get; set; }


        }

        #endregion

        #region 全国专用

        /// <summary>
        /// 全国数据
        /// 小品类平均单价(全国/月)一共有两种数据：单店和全国
        /// </summary>
        public class Area
        {
            public class ListModel
            {
                //[ParamDescription("公司代码")]
                //public string CompanyID { get; set; }

                [ParamDescription("年份")]
                public int Yearv { get; set; }

                [ParamDescription("月份")]
                public int Monthv { get; set; }

                //[ParamDescription("全国/店铺")]
                //public int AreaOrShop { get; set; }

                [ParamDescription("商品分区")]
                public string ParentAreaID { get; set; }

                //[ParamDescription("店铺")]
                //public string ShopID { get; set; }

                [ParamDescription("类别")]
                public string KindID { get; set; }

                [ParamDescription("系列")]
                public string SeriesID { get; set; }

                [ParamDescription("商品层")]
                public string MaterialProperty { get; set; }

                [ParamDescription("品类")]
                public string ModelID { get; set; }

                [ParamDescription("小品类")]
                public string ItemID { get; set; }

                [ParamDescription("价格带")]
                public string PriceName { get; set; }

                [ParamDescription("配货数量")]
                public int MoveQty { get; set; }

                [ParamDescription("配货金额占比")]
                public decimal MoveQtyRate { get; set; }

                [ParamDescription("供货金额")]
                public int SupplyQty { get; set; }

                [ParamDescription("供货金额占比")]
                public decimal SupplyQtyRate { get; set; }

                [ParamDescription("销售金额")]
                public int SaleQty { get; set; }

                [ParamDescription("销售金额占比")]
                public decimal SaleQtyRate { get; set; }

                [ParamDescription("配销比")]
                public decimal MSRate { get; set; }

                [ParamDescription("平均配销比")]
                public decimal AvgMSRate { get; set; }

                [ParamDescription("标准金额占比")]
                public decimal StandAmountRate { get; set; }

                [ParamDescription("换算百分比")]
                public decimal CalcStandAmountRate { get; set; }

                [ParamDescription("自动取值")]
                public decimal PtStandAmountRate { get; set; }

                [ParamDescription("标准金额百分比")]
                public decimal AutoStandAmountRate { get; set; }

                [ParamDescription("确认标准金额百分比")]
                public decimal CkPtStandAmountRate { get; set; }

                [ParamDescription("平均单价")]
                public decimal AvgPrice { get; set; }

                //[ParamDescription("备注")]
                //public string Remark { get; set; }

                //[ParamDescription("审核状态")]
                //public int CheckState { get; set; }

                //[ParamDescription("审核人")]
                //public string Checker { get; set; }

                //[ParamDescription("修改时间")]
                //public DateTime MofifyDTM { get; set; }

                //[ParamDescription("新增记录标记")]
                //public int AddFlag { get; set; }


                //新增
                [ParamDescription("类型名")]
                public string KindName { get; set; }

                [ParamDescription("系列名")]
                public string SeriesName { get; set; }

                [ParamDescription("品类名")]
                public string ModelName { get; set; }

                [ParamDescription("小品类名")]
                public string ItemName { get; set; }
            }


            public class UpdateModelList
            {
                /// <summary>
                /// 区域月份
                /// </summary>
                public IList<UpdateModel> List { get; set; }
            }


            public class UpdateModel
            {
                //[ParamDescription("公司代码")]
                //public string CompanyID { get; set; }

                [ParamDescription("年份")]
                public int Yearv { get; set; }

                [ParamDescription("月份")]
                public int Monthv { get; set; }

                //[ParamDescription("全国/店铺")]
                //public int AreaOrShop { get; set; }

                //[ParamDescription("商品区域")]
                //public string ParentAreaID { get; set; }

                //[ParamDescription("店铺")]
                //public string ShopID { get; set; }

                [ParamDescription("类别")]
                public string KindID { get; set; }

                [ParamDescription("系列")]
                public string SeriesID { get; set; }

                [ParamDescription("商品层")]
                public string MaterialProperty { get; set; }

                [ParamDescription("品类")]
                public string ModelID { get; set; }

                [ParamDescription("小品类")]
                public string ItemID { get; set; }

                [ParamDescription("价格带")]
                public string PriceName { get; set; }

                //[ParamDescription("配货数量")]
                //public int MoveQty { get; set; }

                //[ParamDescription("配货金额占比")]
                //public decimal MoveQtyRate { get; set; }

                //[ParamDescription("供货金额")]
                //public int SupplyQty { get; set; }

                //[ParamDescription("供货金额占比")]
                //public decimal SupplyQtyRate { get; set; }

                //[ParamDescription("销售金额")]
                //public int SaleQty { get; set; }

                //[ParamDescription("销售金额占比")]
                //public decimal SaleQtyRate { get; set; }

                //[ParamDescription("配销比")]
                //public decimal MSRate { get; set; }

                //[ParamDescription("平均配销比")]
                //public decimal AvgMSRate { get; set; }

                //[ParamDescription("标准金额占比")]
                //public decimal StandAmountRate { get; set; }

                //[ParamDescription("换算百分比")]
                //public decimal CalcStandAmountRate { get; set; }

                //[ParamDescription("自动取值")]
                //public decimal PtStandAmountRate { get; set; }

                //[ParamDescription("标准金额百分比")]
                //public decimal AutoStandAmountRate { get; set; }

                [ParamDescription("确认标准金额百分比")]
                public decimal CkPtStandAmountRate { get; set; }

                //[ParamDescription("平均单价")]
                //public decimal AvgPrice { get; set; }

                //[ParamDescription("备注")]
                //public string Remark { get; set; }

                //[ParamDescription("审核状态")]
                //public int CheckState { get; set; }

                //[ParamDescription("审核人")]
                //public string Checker { get; set; }

                //[ParamDescription("修改时间")]
                //public DateTime MofifyDTM { get; set; }

                //[ParamDescription("新增记录标记")]
                //public int AddFlag { get; set; }
            }






            public class ListModelInfo
            {
                public ListModelInfo()
                {
                    List = new List<ItemGroup>();
                }

                /// <summary>
                /// 年
                /// </summary>
                public int Yearv { get; set; }

                /// <summary>
                /// 月
                /// </summary>
                public int Monthv { get; set; }

                /// <summary>
                /// 商品区域
                /// </summary>
                public string ParentAreaID { get; set; }



                /// <summary>
                /// 类型
                /// </summary>
                public string KindID { get; set; }

                /// <summary>
                /// 系列
                /// </summary>
                public string SeriesID { get; set; }

                [ParamDescription("商品层")]
                public string MaterialProperty { get; set; }

                /// <summary>
                /// 品类
                /// </summary>
                public string ModelID { get; set; }

 


                ///// <summary>
                ///// 类别
                ///// </summary>
                //public string KindName { get; set; }

                ///// <summary>
                ///// 系列
                ///// </summary>
                //public string SeriesName { get; set; }

                ///// <summary>
                ///// 上一步的确认值
                ///// </summary>
                //public decimal OldCkPtStandAmountRate { get; set; }

                /// <summary>
                /// 数据集
                /// </summary>
                public List<ItemGroup> List { get; set; }

            }
            public class ItemGroup
            {
                public ItemGroup()
                {
                    ItemList = new List<ListModel>();
                }

                public ItemGroup(string itemId)
                {
                    ItemList = new List<ListModel>();
                    ItemID = itemId;
                }

                public string ItemID { get; set; }
                /// <summary>
                /// 数据集
                /// </summary>

                public List<ListModel> ItemList { get; set; }




            }
        }

        #endregion

        #region 单店专用

        public class Shop
        {
            public class ListModel
            {
                //[ParamDescription("公司代码")]
                //public string CompanyID { get; set; }

                [ParamDescription("年份")]
                public int Yearv { get; set; }

                [ParamDescription("月份")]
                public int Monthv { get; set; }

                //[ParamDescription("全国/店铺")]
                //public int AreaOrShop { get; set; }

                [ParamDescription("商品分区")]
                public string ParentAreaID { get; set; }

                [ParamDescription("店铺")]
                public string ShopID { get; set; }

                [ParamDescription("类别")]
                public string KindID { get; set; }

                [ParamDescription("系列")]
                public string SeriesID { get; set; }

                [ParamDescription("商品层")]
                public string MaterialProperty { get; set; }

                [ParamDescription("品类")]
                public string ModelID { get; set; }

                [ParamDescription("小品类")]
                public string ItemID { get; set; }

                [ParamDescription("价格带")]
                public string PriceName { get; set; }

                [ParamDescription("配货数量")]
                public int MoveQty { get; set; }

                [ParamDescription("配货金额占比")]
                public decimal MoveQtyRate { get; set; }

                [ParamDescription("供货金额")]
                public int SupplyQty { get; set; }

                [ParamDescription("供货金额占比")]
                public decimal SupplyQtyRate { get; set; }

                [ParamDescription("销售金额")]
                public int SaleQty { get; set; }

                [ParamDescription("销售金额占比")]
                public decimal SaleQtyRate { get; set; }

                [ParamDescription("配销比")]
                public decimal MSRate { get; set; }

                [ParamDescription("平均配销比")]
                public decimal AvgMSRate { get; set; }

                [ParamDescription("标准金额占比")]
                public decimal StandAmountRate { get; set; }

                [ParamDescription("换算百分比")]
                public decimal CalcStandAmountRate { get; set; }

                [ParamDescription("自动取值")]
                public decimal PtStandAmountRate { get; set; }

                [ParamDescription("标准金额百分比")]
                public decimal AutoStandAmountRate { get; set; }

                [ParamDescription("确认标准金额百分比")]
                public decimal CkPtStandAmountRate { get; set; }

                [ParamDescription("平均单价")]
                public decimal AvgPrice { get; set; }

                //[ParamDescription("备注")]
                //public string Remark { get; set; }

                //[ParamDescription("审核状态")]
                //public int CheckState { get; set; }

                //[ParamDescription("审核人")]
                //public string Checker { get; set; }

                //[ParamDescription("修改时间")]
                //public DateTime MofifyDTM { get; set; }

                //[ParamDescription("新增记录标记")]
                //public int AddFlag { get; set; }

                //新增

                [ParamDescription("店铺名")]
                public string ShopName { get; set; }

                [ParamDescription("类型名")]
                public string KindName { get; set; }

                [ParamDescription("系列名")]
                public string SeriesName { get; set; }

                [ParamDescription("品类名")]
                public string ModelName { get; set; }

                [ParamDescription("小品类名")]
                public string ItemName { get; set; }

            }

            public class UpdateModelList
            {
                /// <summary>
                /// 区域月份
                /// </summary>
                public IList<UpdateModel> List { get; set; }
            }

            public class UpdateModel
            {
                //[ParamDescription("公司代码")]
                //public string CompanyID { get; set; }

                [ParamDescription("年份")]
                public int Yearv { get; set; }

                [ParamDescription("月份")]
                public int Monthv { get; set; }

                //[ParamDescription("全国/店铺")]
                //public int AreaOrShop { get; set; }

                [ParamDescription("商品区域")]
                public string ParentAreaID { get; set; }

                //[ParamDescription("店铺")]
                //public string ShopID { get; set; }

                [ParamDescription("类别")]
                public string KindID { get; set; }

                [ParamDescription("系列")]
                public string SeriesID { get; set; }

                [ParamDescription("商品层")]
                public string MaterialProperty { get; set; }

                [ParamDescription("品类")]
                public string ModelID { get; set; }

                [ParamDescription("小品类")]
                public string ItemID { get; set; }

                [ParamDescription("价格带")]
                public string PriceName { get; set; }

                //[ParamDescription("配货数量")]
                //public int MoveQty { get; set; }

                //[ParamDescription("配货金额占比")]
                //public decimal MoveQtyRate { get; set; }

                //[ParamDescription("供货金额")]
                //public int SupplyQty { get; set; }

                //[ParamDescription("供货金额占比")]
                //public decimal SupplyQtyRate { get; set; }

                //[ParamDescription("销售金额")]
                //public int SaleQty { get; set; }

                //[ParamDescription("销售金额占比")]
                //public decimal SaleQtyRate { get; set; }

                //[ParamDescription("配销比")]
                //public decimal MSRate { get; set; }

                //[ParamDescription("平均配销比")]
                //public decimal AvgMSRate { get; set; }

                //[ParamDescription("标准金额占比")]
                //public decimal StandAmountRate { get; set; }

                //[ParamDescription("换算百分比")]
                //public decimal CalcStandAmountRate { get; set; }

                //[ParamDescription("自动取值")]
                //public decimal PtStandAmountRate { get; set; }

                //[ParamDescription("标准金额百分比")]
                //public decimal AutoStandAmountRate { get; set; }

                [ParamDescription("确认标准金额百分比")]
                public decimal CkPtStandAmountRate { get; set; }

                //[ParamDescription("平均单价")]
                //public decimal AvgPrice { get; set; }

                //[ParamDescription("备注")]
                //public string Remark { get; set; }

                //[ParamDescription("审核状态")]
                //public int CheckState { get; set; }

                //[ParamDescription("审核人")]
                //public string Checker { get; set; }

                //[ParamDescription("修改时间")]
                //public DateTime MofifyDTM { get; set; }

                //[ParamDescription("新增记录标记")]
                //public int AddFlag { get; set; }
            }

            public class ListModelInfo
            {
                public ListModelInfo()
                {
                    List = new List<ItemGroup>();
                }

                /// <summary>
                /// 年
                /// </summary>
                public int Yearv { get; set; }

                /// <summary>
                /// 月
                /// </summary>
                public int Monthv { get; set; }

                /// <summary>
                /// 商品区域
                /// </summary>
                public string ParentAreaID { get; set; }



                /// <summary>
                /// 类型
                /// </summary>
                public string KindID { get; set; }

                /// <summary>
                /// 系列
                /// </summary>
                public string SeriesID { get; set; }

                [ParamDescription("商品层")]
                public string MaterialProperty { get; set; }

                /// <summary>
                /// 品类
                /// </summary>
                public string ModelID { get; set; }




                ///// <summary>
                ///// 类别
                ///// </summary>
                //public string KindName { get; set; }

                ///// <summary>
                ///// 系列
                ///// </summary>
                //public string SeriesName { get; set; }

                ///// <summary>
                ///// 上一步的确认值
                ///// </summary>
                //public decimal OldCkPtStandAmountRate { get; set; }

                /// <summary>
                /// 数据集
                /// </summary>
                public List<ItemGroup> List { get; set; }

            }

            public class ItemGroup
            {
                public ItemGroup()
                {
                    ItemList = new List<ListModel>();
                }

                public ItemGroup(string itemId)
                {
                    ItemList = new List<ListModel>();
                    ItemID = itemId;
                }

                public string ItemID { get; set; }
                /// <summary>
                /// 数据集
                /// </summary>

                public List<ListModel> ItemList { get; set; }

            }
        }
        #endregion

        public class GroupModel
        {
            [ParamDescription("公司代码")]
            public string CompanyID { get; set; }

            [ParamDescription("年份")]
            public int Yearv { get; set; }


            [ParamDescription("月份")]
            public int Monthv { get; set; }


            [ParamDescription("商品分区")]
            public string ParentAreaID { get; set; }


            [ParamDescription("类别ID")]
            public string KindID { get; set; }


            [ParamDescription("系列ID")]
            public string SeriesID { get; set; }


            //[ParamDescription("星期")]
            //public int Weekv { get; set; }


            [ParamDescription("店铺ID")]
            public string ShopID { get; set; }

            [ParamDescription("品类")]
            public string ModelID { get; set; }

            [ParamDescription("小品类")]
            public string ItemID { get; set; }

            [ParamDescription("商品层")]
            public string MaterialProperty { get; set; }

            [ParamDescription("全国-区域")]
            public int AreaOrShop { get; set; }


        }

    }
}
